﻿<UserControl x:Class="Agnes.Mainframe.MainframeView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:cal="http://www.caliburnproject.org"
             xmlns:core="clr-namespace:Agnes.Core;assembly=Agnes.Core"
             xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon"
             xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
             xmlns:dxre="http://schemas.devexpress.com/winfx/2008/xaml/richedit"
             xmlns:dxd="http://schemas.devexpress.com/winfx/2008/xaml/docking"
             xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors" mc:Ignorable="d" 
             d:DesignHeight="508" d:DesignWidth="689">
    <Grid>
        <Grid.Resources>
            <ResourceDictionary>
                <dxre:RichEditUICommand x:Key="commands" /> 
                <dxre:DefaultBarItemDataTemplates x:Key="defaultBarItemTemplates" />
                <dxre:RichEditStringIdConverter x:Key="stringIdConverter" />
            </ResourceDictionary>
        </Grid.Resources>
        
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="0" />
        </Grid.RowDefinitions>
        
        <dxb:BarManager Name="DxBarManager" >
            <dxb:BarManager.Items>
                <dxb:BarButtonItem Command="{Binding Path=EditUndo, Mode=OneTime, Source={StaticResource commands}}" Name="biEditUndo" />
                <dxb:BarButtonItem Command="{Binding Path=EditRedo, Mode=OneTime, Source={StaticResource commands}}" Name="biEditRedo" />
                <dxb:BarButtonItem Command="{Binding Path=InsertTable, Mode=OneTime, Source={StaticResource commands}}" Name="biInsertTable" />
                <dxb:BarButtonItem Command="{Binding Path=InsertPicture, Mode=OneTime, Source={StaticResource commands}}" Name="biInsertPicture" />
                <dxb:BarButtonItem Command="{Binding Path=InsertFloatingPicture, Mode=OneTime, Source={StaticResource commands}}" Name="biInsertFloatingPicture" />
               
                <dxb:BarButtonItem Command="{Binding Path=InsertBookmark, Mode=OneTime, Source={StaticResource commands}}" Name="biInsertBookmark" />
                <dxb:BarButtonItem Command="{Binding Path=InsertHyperlink, Mode=OneTime, Source={StaticResource commands}}" Name="biInsertHyperlink" />
                
                <dxb:BarButtonItem Command="{Binding Path=InsertSymbol, Mode=OneTime, Source={StaticResource commands}}" Name="biInsertSymbol" />
                
                <dxre:BarSplitButtonColorEditItem Command="{Binding Path=TableChangeCellsShading, Mode=OneTime, Source={StaticResource commands}}" Name="biTableChangeCellsShading">
                    <dxre:BarSplitButtonColorEditItem.PopupControl>
                        <dxb:PopupControlContainerInfo>
                            <dxe:ColorEdit EditValue="{Binding ElementName=biTableChangeCellsShading, Mode=TwoWay, Path=EditValue}" ShowBorder="False" ShowDefaultColorButton="False" ShowNoColorButton="True" />
                        </dxb:PopupControlContainerInfo>
                    </dxre:BarSplitButtonColorEditItem.PopupControl>
                </dxre:BarSplitButtonColorEditItem>
                <dxb:BarSubItem Command="{Binding Path=TableChangeBorders, Mode=OneTime, Source={StaticResource commands}}" Name="biTableChangeBorders">
                    <dxb:BarSubItem.ItemLinks>
                        <dxb:BarCheckItemLink BarItemName="biTableToggleBottomBorder" />
                        <dxb:BarCheckItemLink BarItemName="biTableToggleTopBorder" />
                        <dxb:BarCheckItemLink BarItemName="biTableToggleLeftBorder" />
                        <dxb:BarCheckItemLink BarItemName="biTableToggleRightBorder" />
                        <dxb:BarButtonItemLink BarItemName="biTableResetAllBorders" />
                        <dxb:BarCheckItemLink BarItemName="biTableToggleAllBorders" />
                        <dxb:BarCheckItemLink BarItemName="biTableToggleOutsideBorder" />
                        <dxb:BarCheckItemLink BarItemName="biTableToggleInsideBorder" />
                        <dxb:BarCheckItemLink BarItemName="biTableToggleInsideHorizontalBorder" />
                        <dxb:BarCheckItemLink BarItemName="biTableToggleInsideVerticalBorder" />
                    </dxb:BarSubItem.ItemLinks>
                </dxb:BarSubItem>
                <dxb:BarCheckItem Command="{Binding Path=TableToggleBottomBorder, Mode=OneTime, Source={StaticResource commands}}" Name="biTableToggleBottomBorder" />
                <dxb:BarCheckItem Command="{Binding Path=TableToggleTopBorder, Mode=OneTime, Source={StaticResource commands}}" Name="biTableToggleTopBorder" />
                <dxb:BarCheckItem Command="{Binding Path=TableToggleLeftBorder, Mode=OneTime, Source={StaticResource commands}}" Name="biTableToggleLeftBorder" />
                <dxb:BarCheckItem Command="{Binding Path=TableToggleRightBorder, Mode=OneTime, Source={StaticResource commands}}" Name="biTableToggleRightBorder" />
                <dxb:BarButtonItem Command="{Binding Path=TableResetAllBorders, Mode=OneTime, Source={StaticResource commands}}" Name="biTableResetAllBorders" />
                <dxb:BarCheckItem Command="{Binding Path=TableToggleAllBorders, Mode=OneTime, Source={StaticResource commands}}" Name="biTableToggleAllBorders" />
                <dxb:BarCheckItem Command="{Binding Path=TableToggleOutsideBorder, Mode=OneTime, Source={StaticResource commands}}" Name="biTableToggleOutsideBorder" />
                <dxb:BarCheckItem Command="{Binding Path=TableToggleInsideBorder, Mode=OneTime, Source={StaticResource commands}}" Name="biTableToggleInsideBorder" />
                <dxb:BarCheckItem Command="{Binding Path=TableToggleInsideHorizontalBorder, Mode=OneTime, Source={StaticResource commands}}" Name="biTableToggleInsideHorizontalBorder" />
                <dxb:BarCheckItem Command="{Binding Path=TableToggleInsideVerticalBorder, Mode=OneTime, Source={StaticResource commands}}" Name="biTableToggleInsideVerticalBorder" />
                <dxre:BarSplitButtonColorEditItem Command="{Binding Path=TableChangeCellsBorderColor, Mode=OneTime, Source={StaticResource commands}}" Name="biTableChangeCellsBorderColor">
                    <dxre:BarSplitButtonColorEditItem.PopupControl>
                        <dxb:PopupControlContainerInfo>
                            <dxe:ColorEdit EditValue="{Binding ElementName=biTableChangeCellsBorderColor, Mode=TwoWay, Path=EditValue}" ShowBorder="False" />
                        </dxb:PopupControlContainerInfo>
                    </dxre:BarSplitButtonColorEditItem.PopupControl>
                </dxre:BarSplitButtonColorEditItem>
                <dxb:BarButtonItem Command="{Binding Path=TableInsertRowAbove, Mode=OneTime, Source={StaticResource commands}}" Name="biTableInsertRowAbove" />
                <dxb:BarButtonItem Command="{Binding Path=TableInsertRowBelow, Mode=OneTime, Source={StaticResource commands}}" Name="biTableInsertRowBelow" />
                <dxb:BarButtonItem Command="{Binding Path=TableInsertColumnToLeft, Mode=OneTime, Source={StaticResource commands}}" Name="biTableInsertColumnToLeft" />
                <dxb:BarButtonItem Command="{Binding Path=TableInsertColumnToRight, Mode=OneTime, Source={StaticResource commands}}" Name="biTableInsertColumnToRight" />
                <dxb:BarButtonItem Command="{Binding Path=TableMergeCells, Mode=OneTime, Source={StaticResource commands}}" Name="biTableMergeCells" />
                <dxb:BarButtonItem Command="{Binding Path=TableSplit, Mode=OneTime, Source={StaticResource commands}}" Name="biTableSplit" />
                <dxb:BarCheckItem Command="{Binding Path=TableToggleCellsTopLeftAlignment, Mode=OneTime, Source={StaticResource commands}}" Name="biTableToggleCellsTopLeftAlignment" />
                <dxb:BarCheckItem Command="{Binding Path=TableToggleCellsTopCenterAlignment, Mode=OneTime, Source={StaticResource commands}}" Name="biTableToggleCellsTopCenterAlignment" />
                <dxb:BarCheckItem Command="{Binding Path=TableToggleCellsTopRightAlignment, Mode=OneTime, Source={StaticResource commands}}" Name="biTableToggleCellsTopRightAlignment" />
                <dxb:BarCheckItem Command="{Binding Path=TableToggleCellsMiddleLeftAlignment, Mode=OneTime, Source={StaticResource commands}}" Name="biTableToggleCellsMiddleLeftAlignment" />
                <dxb:BarCheckItem Command="{Binding Path=TableToggleCellsMiddleCenterAlignment, Mode=OneTime, Source={StaticResource commands}}" Name="biTableToggleCellsMiddleCenterAlignment" />
                <dxb:BarCheckItem Command="{Binding Path=TableToggleCellsMiddleRightAlignment, Mode=OneTime, Source={StaticResource commands}}" Name="biTableToggleCellsMiddleRightAlignment" />
                <dxb:BarCheckItem Command="{Binding Path=TableToggleCellsBottomLeftAlignment, Mode=OneTime, Source={StaticResource commands}}" Name="biTableToggleCellsBottomLeftAlignment" />
                <dxb:BarCheckItem Command="{Binding Path=TableToggleCellsBottomCenterAlignment, Mode=OneTime, Source={StaticResource commands}}" Name="biTableToggleCellsBottomCenterAlignment" />
                <dxb:BarCheckItem Command="{Binding Path=TableToggleCellsBottomRightAlignment, Mode=OneTime, Source={StaticResource commands}}" Name="biTableToggleCellsBottomRightAlignment" />
                <dxb:BarButtonItem Command="{Binding Path=EditPaste, Mode=OneTime, Source={StaticResource commands}}" Name="biEditPaste" />
                <dxb:BarButtonItem Command="{Binding Path=EditCut, Mode=OneTime, Source={StaticResource commands}}" Name="biEditCut" />
                <dxb:BarButtonItem Command="{Binding Path=EditCopy, Mode=OneTime, Source={StaticResource commands}}" Name="biEditCopy" />
                <dxb:BarButtonItem Command="{Binding Path=EditPasteSpecial, Mode=OneTime, Source={StaticResource commands}}" Name="biEditPasteSpecial" />
                <dxr:BarButtonGroup Name="biFont">
                    <dxr:BarButtonGroup.ItemLinks>
                        <dxb:BarEditItemLink BarItemName="biFormatFontName" />
                        <dxb:BarEditItemLink BarItemName="biFormatFontSize" />
                    </dxr:BarButtonGroup.ItemLinks>
                </dxr:BarButtonGroup>
                <dxb:BarEditItem Command="{Binding Path=FormatFontName, Mode=OneTime, Source={StaticResource commands}}" Content="" EditWidth="150" Name="biFormatFontName">
                    <dxb:BarEditItem.EditSettings>
                        <dxre:FontComboBoxEditSettings />
                    </dxb:BarEditItem.EditSettings>
                </dxb:BarEditItem>
                <dxb:BarEditItem Command="{Binding Path=FormatFontSize, Mode=OneTime, Source={StaticResource commands}}" Content="" EditWidth="50" Name="biFormatFontSize">
                    <dxb:BarEditItem.EditSettings>
                        <dxre:RichEditFontSizeComboBoxEditSettings RichEditControl="{Binding ElementName=richEdit}" />
                    </dxb:BarEditItem.EditSettings>
                </dxb:BarEditItem>
                <dxr:BarButtonGroup Name="biFontSize">
                    <dxr:BarButtonGroup.ItemLinks>
                        <dxb:BarButtonItemLink BarItemName="biFormatIncreaseFontSize" />
                        <dxb:BarButtonItemLink BarItemName="biFormatDecreaseFontSize" />
                    </dxr:BarButtonGroup.ItemLinks>
                </dxr:BarButtonGroup>
                <dxb:BarButtonItem Command="{Binding Path=FormatIncreaseFontSize, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatIncreaseFontSize" />
                <dxb:BarButtonItem Command="{Binding Path=FormatDecreaseFontSize, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatDecreaseFontSize" />
                <dxr:BarButtonGroup Name="biClearFormatting">
                    <dxr:BarButtonGroup.ItemLinks>
                        <dxb:BarButtonItemLink BarItemName="biFormatClearFormatting" />
                    </dxr:BarButtonGroup.ItemLinks>
                </dxr:BarButtonGroup>
                <dxb:BarButtonItem Command="{Binding Path=FormatClearFormatting, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatClearFormatting" />
                <dxr:BarButtonGroup Name="biFontShape">
                    <dxr:BarButtonGroup.ItemLinks>
                        <dxb:BarCheckItemLink BarItemName="biFormatFontBold" />
                        <dxb:BarCheckItemLink BarItemName="biFormatFontItalic" />
                        <dxb:BarCheckItemLink BarItemName="biFormatFontUnderline" />
                        <dxb:BarCheckItemLink BarItemName="biFormatFontDoubleUnderline" />
                        <dxb:BarCheckItemLink BarItemName="biFormatFontStrikeout" />
                        <dxb:BarCheckItemLink BarItemName="biFormatFontDoubleStrikeout" />
                        <dxb:BarCheckItemLink BarItemName="biFormatFontSuperscript" />
                        <dxb:BarCheckItemLink BarItemName="biFormatFontSubscript" />
                        <dxb:BarSubItemLink BarItemName="biEditChangeCase" />
                    </dxr:BarButtonGroup.ItemLinks>
                </dxr:BarButtonGroup>
                <dxb:BarCheckItem Command="{Binding Path=FormatFontBold, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatFontBold" />
                <dxb:BarCheckItem Command="{Binding Path=FormatFontItalic, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatFontItalic" />
                <dxb:BarCheckItem Command="{Binding Path=FormatFontUnderline, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatFontUnderline" />
                <dxb:BarCheckItem Command="{Binding Path=FormatFontDoubleUnderline, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatFontDoubleUnderline" />
                <dxb:BarCheckItem Command="{Binding Path=FormatFontStrikeout, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatFontStrikeout" />
                <dxb:BarCheckItem Command="{Binding Path=FormatFontDoubleStrikeout, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatFontDoubleStrikeout" />
                <dxb:BarCheckItem Command="{Binding Path=FormatFontSuperscript, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatFontSuperscript" />
                <dxb:BarCheckItem Command="{Binding Path=FormatFontSubscript, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatFontSubscript" />
                <dxb:BarSubItem Command="{Binding Path=EditChangeCase, Mode=OneTime, Source={StaticResource commands}}" Name="biEditChangeCase">
                    <dxb:BarSubItem.ItemLinks>
                        <dxb:BarButtonItemLink BarItemName="biEditMakeUpperCase" />
                        <dxb:BarButtonItemLink BarItemName="biEditMakeLowerCase" />
                        <dxb:BarButtonItemLink BarItemName="biEditToggleCase" />
                    </dxb:BarSubItem.ItemLinks>
                </dxb:BarSubItem>
                <dxb:BarButtonItem Command="{Binding Path=EditMakeUpperCase, Mode=OneTime, Source={StaticResource commands}}" Name="biEditMakeUpperCase" />
                <dxb:BarButtonItem Command="{Binding Path=EditMakeLowerCase, Mode=OneTime, Source={StaticResource commands}}" Name="biEditMakeLowerCase" />
                <dxb:BarButtonItem Command="{Binding Path=EditToggleCase, Mode=OneTime, Source={StaticResource commands}}" Name="biEditToggleCase" />
                <dxr:BarButtonGroup Name="biFontColor">
                    <dxr:BarButtonGroup.ItemLinks>
                        <dxre:BarSplitButtonColorEditItemLink BarItemName="biFormatFontBackColor" />
                        <dxre:BarSplitButtonColorEditItemLink BarItemName="biFormatFontForeColor" />
                    </dxr:BarButtonGroup.ItemLinks>
                </dxr:BarButtonGroup>
                <dxre:BarSplitButtonColorEditItem Command="{Binding Path=FormatFontBackColor, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatFontBackColor">
                    <dxre:BarSplitButtonColorEditItem.PopupControl>
                        <dxb:PopupControlContainerInfo>
                            <dxe:ColorEdit EditValue="{Binding ElementName=biFormatFontBackColor, Mode=TwoWay, Path=EditValue}" ShowBorder="False" ColumnCount="5" ChipSize="Large" ChipMargin="3" ShowDefaultColorButton="false" ShowMoreColorsButton="False" ShowNoColorButton="True">
                                <dxe:ColorEdit.Palettes>
                                    <dxre:CharactersBackgroundColorPaletteCollection />
                                </dxe:ColorEdit.Palettes>
                            </dxe:ColorEdit>
                        </dxb:PopupControlContainerInfo>
                    </dxre:BarSplitButtonColorEditItem.PopupControl>
                </dxre:BarSplitButtonColorEditItem>
                <dxre:BarSplitButtonColorEditItem Command="{Binding Path=FormatFontForeColor, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatFontForeColor">
                    <dxre:BarSplitButtonColorEditItem.PopupControl>
                        <dxb:PopupControlContainerInfo>
                            <dxe:ColorEdit EditValue="{Binding ElementName=biFormatFontForeColor, Mode=TwoWay, Path=EditValue}" ShowBorder="False" />
                        </dxb:PopupControlContainerInfo>
                    </dxre:BarSplitButtonColorEditItem.PopupControl>
                </dxre:BarSplitButtonColorEditItem>
                <dxr:BarButtonGroup Name="biNumberingList">
                    <dxr:BarButtonGroup.ItemLinks>
                        <dxb:BarCheckItemLink BarItemName="biFormatBulletedList" />
                        <dxb:BarCheckItemLink BarItemName="biFormatNumberingList" />
                        <dxb:BarCheckItemLink BarItemName="biFormatMultilevelList" />
                    </dxr:BarButtonGroup.ItemLinks>
                </dxr:BarButtonGroup>
                <dxb:BarCheckItem Command="{Binding Path=FormatBulletedList, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatBulletedList" />
                <dxb:BarCheckItem Command="{Binding Path=FormatNumberingList, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatNumberingList" />
                <dxb:BarCheckItem Command="{Binding Path=FormatMultilevelList, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatMultilevelList" />
                <dxr:BarButtonGroup Name="biParagraphIndent">
                    <dxr:BarButtonGroup.ItemLinks>
                        <dxb:BarButtonItemLink BarItemName="biFormatDecreaseIndent" />
                        <dxb:BarButtonItemLink BarItemName="biFormatIncreaseIndent" />
                    </dxr:BarButtonGroup.ItemLinks>
                </dxr:BarButtonGroup>
                <dxb:BarButtonItem Command="{Binding Path=FormatDecreaseIndent, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatDecreaseIndent" />
                <dxb:BarButtonItem Command="{Binding Path=FormatIncreaseIndent, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatIncreaseIndent" />
                <dxr:BarButtonGroup Name="biShowWhitespace">
                    <dxr:BarButtonGroup.ItemLinks>
                        <dxb:BarCheckItemLink BarItemName="biViewShowWhitespace" />
                    </dxr:BarButtonGroup.ItemLinks>
                </dxr:BarButtonGroup>
                <dxb:BarCheckItem Command="{Binding Path=ViewShowWhitespace, Mode=OneTime, Source={StaticResource commands}}" Name="biViewShowWhitespace" />
                <dxr:BarButtonGroup Name="biParagraphAlignment">
                    <dxr:BarButtonGroup.ItemLinks>
                        <dxb:BarCheckItemLink BarItemName="biFormatParagraphAlignLeft" />
                        <dxb:BarCheckItemLink BarItemName="biFormatParagraphAlignCenter" />
                        <dxb:BarCheckItemLink BarItemName="biFormatParagraphAlignRight" />
                        <dxb:BarCheckItemLink BarItemName="biFormatParagraphAlignJustify" />
                    </dxr:BarButtonGroup.ItemLinks>
                </dxr:BarButtonGroup>
                <dxb:BarCheckItem Command="{Binding Path=FormatParagraphAlignLeft, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatParagraphAlignLeft" />
                <dxb:BarCheckItem Command="{Binding Path=FormatParagraphAlignCenter, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatParagraphAlignCenter" />
                <dxb:BarCheckItem Command="{Binding Path=FormatParagraphAlignRight, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatParagraphAlignRight" />
                <dxb:BarCheckItem Command="{Binding Path=FormatParagraphAlignJustify, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatParagraphAlignJustify" />
                <dxr:BarButtonGroup Name="biLineSpacing">
                    <dxr:BarButtonGroup.ItemLinks>
                        <dxb:BarSubItemLink BarItemName="biFormatParagraphLineSpacing" />
                        <dxre:BarSplitButtonColorEditItemLink BarItemName="biFormatParagraphBackColor" />
                    </dxr:BarButtonGroup.ItemLinks>
                </dxr:BarButtonGroup>
                <dxb:BarSubItem Command="{Binding Path=FormatParagraphLineSpacing, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatParagraphLineSpacing">
                    <dxb:BarSubItem.ItemLinks>
                        <dxb:BarCheckItemLink BarItemName="biFormatParagraphLineSpacingSingle" />
                        <dxb:BarCheckItemLink BarItemName="biFormatParagraphLineSpacingSesquialteral" />
                        <dxb:BarCheckItemLink BarItemName="biFormatParagraphLineSpacingDouble" />
                        <dxb:BarButtonItemLink BarItemName="biFormatParagraphLineSpacingCustomize" />
                        <dxb:BarButtonItemLink BarItemName="biFormatParagraphAddSpacingBefore" />
                        <dxb:BarButtonItemLink BarItemName="biFormatParagraphRemoveSpacingBefore" />
                        <dxb:BarButtonItemLink BarItemName="biFormatParagraphAddSpacingAfter" />
                        <dxb:BarButtonItemLink BarItemName="biFormatParagraphRemoveSpacingAfter" />
                    </dxb:BarSubItem.ItemLinks>
                </dxb:BarSubItem>
                <dxb:BarCheckItem Command="{Binding Path=FormatParagraphLineSpacingSingle, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatParagraphLineSpacingSingle" />
                <dxb:BarCheckItem Command="{Binding Path=FormatParagraphLineSpacingSesquialteral, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatParagraphLineSpacingSesquialteral" />
                <dxb:BarCheckItem Command="{Binding Path=FormatParagraphLineSpacingDouble, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatParagraphLineSpacingDouble" />
                <dxb:BarButtonItem Command="{Binding Path=FormatParagraphLineSpacingCustomize, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatParagraphLineSpacingCustomize" />
                <dxb:BarButtonItem Command="{Binding Path=FormatParagraphAddSpacingBefore, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatParagraphAddSpacingBefore" />
                <dxb:BarButtonItem Command="{Binding Path=FormatParagraphRemoveSpacingBefore, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatParagraphRemoveSpacingBefore" />
                <dxb:BarButtonItem Command="{Binding Path=FormatParagraphAddSpacingAfter, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatParagraphAddSpacingAfter" />
                <dxb:BarButtonItem Command="{Binding Path=FormatParagraphRemoveSpacingAfter, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatParagraphRemoveSpacingAfter" />
                <dxre:BarSplitButtonColorEditItem Command="{Binding Path=FormatParagraphBackColor, Mode=OneTime, Source={StaticResource commands}}" Name="biFormatParagraphBackColor">
                    <dxre:BarSplitButtonColorEditItem.PopupControl>
                        <dxb:PopupControlContainerInfo>
                            <UserControl>
                                <dxe:ColorEdit EditValue="{Binding ElementName=biFormatParagraphBackColor, Mode=TwoWay, Path=EditValue}" ShowBorder="False" ShowDefaultColorButton="False" ShowNoColorButton="True" />
                            </UserControl>
                        </dxb:PopupControlContainerInfo>
                    </dxre:BarSplitButtonColorEditItem.PopupControl>
                </dxre:BarSplitButtonColorEditItem>
                <dxb:BarEditItem Command="{Binding Path=FormatFontStyle, Mode=OneTime, Source={StaticResource commands}}" Content="" EditWidth="150" Name="biFormatFontStyle">
                    <dxb:BarEditItem.EditSettings>
                        <dxre:RichEditStyleComboBoxEditSettings RichEditControl="{Binding ElementName=richEdit}" />
                    </dxb:BarEditItem.EditSettings>
                </dxb:BarEditItem>
                <dxb:BarButtonItem Command="{Binding Path=EditFind, Mode=OneTime, Source={StaticResource commands}}" Name="biEditFind" />
                <dxb:BarButtonItem Command="{Binding Path=EditReplace, Mode=OneTime, Source={StaticResource commands}}" Name="biEditReplace" />
            
            </dxb:BarManager.Items>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <dxr:RibbonControl Name="DxRibbon" Grid.Row="0"  >
                    <dxr:RibbonControl.ApplicationMenu>
                        <dxr:BackstageViewControl>
                            <dxr:BackstageTabItem Content="新建" >
                                <dxr:BackstageTabItem.ControlPane>
                                    <ContentControl Loaded="NewSlnView_Loaded"
                                                    Content="{Binding Path=NewSlnView}"
                                                    MaxWidth="600" HorizontalAlignment="Left" 
                                                    cal:Message.Attach="[Event Loaded]=[Action NewSlnViewLoaded()]"/>
                                </dxr:BackstageTabItem.ControlPane>
                            </dxr:BackstageTabItem>
                            <dxr:BackstageTabItem Content="打开" >
                                <dxr:BackstageTabItem.ControlPane>
                                    <ContentControl Loaded="OpenSlnView_Loaded"
                                                    Content="{Binding Path=OpenSlnView}" 
                                                    MaxWidth="600" HorizontalAlignment="Left"
                                                    cal:Message.Attach="[Event Loaded]=[Action OpenSlnViewLoaded()]"/>
                                </dxr:BackstageTabItem.ControlPane>
                            </dxr:BackstageTabItem>
                            <dxr:BackstageTabItem Content="应用插件" >
                                <dxr:BackstageTabItem.ControlPane>
                                        <Grid Margin="30" HorizontalAlignment="Left"  Loaded="AddIns_Loaded" MaxWidth="600">
                                            <Grid.Resources>
                                                <Style x:Key="LineStyle" TargetType="{x:Type Path}">
                                                    <Setter Property="Margin" Value="0,5,0,0" />
                                                    <Setter Property="StrokeThickness" Value="2" />
                                                    <Setter Property="Fill" Value="Black" />
                                                    <Setter Property="Stroke" Value="LightGray" />
                                                    <Setter Property="Data">
                                                        <Setter.Value>
                                                            <LineGeometry StartPoint="0,0" EndPoint="600,0" />
                                                        </Setter.Value>
                                                    </Setter>
                                                </Style>
                                            </Grid.Resources>
                                            <Grid.RowDefinitions>
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="Auto" />
                                                <RowDefinition Height="*" />
                                                <RowDefinition Height="Auto" />
                                            </Grid.RowDefinitions>
                                            <TextBlock Text="应用插件列表" Grid.Row="0" FontSize="22"/>
                                            <Path Style="{StaticResource LineStyle}" Grid.Row="1" />
                                            <Border Grid.Row="5" Margin="5" BorderBrush="DarkBlue"  BorderThickness="2" CornerRadius="8" MinHeight="30">
                                                <ListBox x:Name="lbAdds" Grid.Row="5" ItemsSource="{Binding Path=RecentlyUsedSlns}" 
                                                         SelectedItem="{Binding Path=SelectedUsedSln}" BorderThickness="0">
                                                    <ListBox.ItemContainerStyle>
                                                        <Style TargetType="{x:Type ListBoxItem}">
                                                            <Style.Resources>
                                                                <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="LightBlue" Opacity=".5"/>
                                                                <SolidColorBrush x:Key="{x:Static SystemColors.HighlightTextBrushKey}" Color="Black" />
                                                            </Style.Resources>
                                                            <Style.Triggers>
                                                                <Trigger Property="IsSelected" Value="true">
                                                                    <Setter Property="FontSize" Value="14" />
                                                                    <Setter Property="Background" Value="AliceBlue" />
                                                                    <Setter Property="BorderBrush" Value="Blue" />
                                                                    <Setter Property="BorderThickness" Value="0.5" />
                                                                </Trigger>
                                                            </Style.Triggers>
                                                        </Style>
                                                    </ListBox.ItemContainerStyle>
                                                <ListBox.ItemTemplate>
                                                    <DataTemplate>
                                                        <StackPanel >
                                                            <TextBlock Margin="5" Text="{Binding Path=Name, StringFormat='插件名：{0}'}" FontWeight="ExtraBold" FontSize="15"/>
                                                            <TextBlock Margin="5" Text="{Binding Path=Author, StringFormat='作者：{0}'}"  />
                                                            <TextBlock Margin="5" Text="{Binding Path=Description, StringFormat='描述: {0}'}" />
                                                            <TextBlock Margin="5" Text="{Binding Path=CopyRight, StringFormat='CopyRight: {0}'}" />
                                                            <TextBlock Margin="5" Text="{Binding Path=Url, StringFormat='Url: {0}'}" />
                                                        </StackPanel>
                                                    </DataTemplate>
                                                </ListBox.ItemTemplate>
                                            </ListBox>
                                            </Border>
                                        </Grid>
                                </dxr:BackstageTabItem.ControlPane>
                            </dxr:BackstageTabItem>
                            <dxr:BackstageTabItem Content="关于">
                                <dxr:BackstageTabItem.ControlPane>
                                    <WebBrowser Source="http://kingmoon.codeplex.com/" />
                                </dxr:BackstageTabItem.ControlPane>
                            </dxr:BackstageTabItem>
                        </dxr:BackstageViewControl>
                    </dxr:RibbonControl.ApplicationMenu>

                    <dxr:RibbonDefaultPageCategory Caption="Default Category" >
                        <dxr:RibbonPage Caption="编辑">
                            <dxr:RibbonPageGroup Caption="操作" >
                                <dxb:BarButtonItemLink BarItemName="biEditUndo" />
                                <dxb:BarButtonItemLink BarItemName="biEditRedo" />
                            </dxr:RibbonPageGroup>
                            <dxr:RibbonPageGroup Caption="剪切板" Name="grpClipboard" ShowCaptionButton="False">
                                <dxb:BarButtonItemLink BarItemName="biEditPaste" />
                                <dxb:BarButtonItemLink BarItemName="biEditCut" />
                                <dxb:BarButtonItemLink BarItemName="biEditCopy" />
                                <dxb:BarButtonItemLink BarItemName="biEditPasteSpecial" />
                            </dxr:RibbonPageGroup>
                            <dxr:RibbonPageGroup Caption="字体" CaptionButtonCommand="{Binding Path=FormatFont, Mode=OneTime, Source={StaticResource commands}}" Name="grpFont">
                                <dxr:BarButtonGroupLink BarItemName="biFont" />
                                <dxr:BarButtonGroupLink BarItemName="biFontSize" />
                                <dxr:BarButtonGroupLink BarItemName="biClearFormatting" />
                                <dxr:BarButtonGroupLink BarItemName="biFontShape" />
                                <dxr:BarButtonGroupLink BarItemName="biFontColor" />
                            </dxr:RibbonPageGroup>
                            <dxr:RibbonPageGroup Caption="段落" CaptionButtonCommand="{Binding Path=FormatParagraph, Mode=OneTime, Source={StaticResource commands}}" Name="grpParagraph">
                                <dxr:BarButtonGroupLink BarItemName="biNumberingList" />
                                <dxr:BarButtonGroupLink BarItemName="biParagraphIndent" />
                                <dxr:BarButtonGroupLink BarItemName="biShowWhitespace" />
                                <dxr:BarButtonGroupLink BarItemName="biParagraphAlignment" />
                                <dxr:BarButtonGroupLink BarItemName="biLineSpacing" />
                            </dxr:RibbonPageGroup>
                            <dxr:RibbonPageGroup Caption="查找与替换" Name="grpEditing" ShowCaptionButton="False">
                                <dxb:BarButtonItemLink BarItemName="biEditFind" />
                                <dxb:BarButtonItemLink BarItemName="biEditReplace" />
                            </dxr:RibbonPageGroup>
                        </dxr:RibbonPage>
                    </dxr:RibbonDefaultPageCategory>
                    <dxr:RibbonPageCategory Caption="插件" PagesSource="{Binding Path=RibbonPages}"/>
                </dxr:RibbonControl>

                <dxd:DockLayoutManager Grid.Row="1">
                    <dxd:DockLayoutManager.AutoHideGroups>
                        <dxd:AutoHideGroup DockType="Right" ShowCaption="True" 
                                           ItemsSource="{Binding core:AgnesServiceManager.AgnesWorkBenchService.RightPads}" >
                            <dxd:AutoHideGroup.ItemCaptionTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Path=Title}" />
                                </DataTemplate>
                            </dxd:AutoHideGroup.ItemCaptionTemplate>
                            <dxd:AutoHideGroup.ItemContentTemplate>
                                <DataTemplate>
                                    <ContentControl Content="{Binding Path=Content}" />
                                </DataTemplate>
                            </dxd:AutoHideGroup.ItemContentTemplate>
                        </dxd:AutoHideGroup>
                    </dxd:DockLayoutManager.AutoHideGroups>
                    <dxd:DockLayoutManager.LayoutRoot>
                        <dxd:LayoutGroup Name="rootGroup" Orientation="Horizontal">
                            <dxd:TabbedGroup Grid.Column="2" ItemWidth="240" 
                                             Name="leftTabContainer"
                                             SelectedTabIndex="1"
                                             ItemsSource="{Binding Path=AgnesWorkBenchService.LeftPads}"
                                             TabItemContainerStyleSelector="{x:Null}" AllowHide="False" >
                                <dxd:TabbedGroup.ItemCaptionTemplate>
                                    <DataTemplate>
                                        <TextBlock Text="{Binding Path=Title}" />
                                    </DataTemplate>
                                </dxd:TabbedGroup.ItemCaptionTemplate>
                                <dxd:TabbedGroup.ItemContentTemplate>
                                    <DataTemplate>
                                        <ContentControl Content="{Binding Path=Content}" />
                                    </DataTemplate>
                                </dxd:TabbedGroup.ItemContentTemplate>
                            </dxd:TabbedGroup>
                            <dxd:LayoutGroup Grid.Column="2" Orientation="Vertical">
                                <dxd:LayoutGroup Orientation="Horizontal">
                                    <dxd:DocumentGroup ClosePageButtonShowMode="InAllTabPageHeaders" Grid.Column="2" ItemWidth="3*"
                                                       Name="documentContainer" >
                                    </dxd:DocumentGroup>
                                </dxd:LayoutGroup>
                                <dxd:TabbedGroup Grid.Row="2" ItemHeight="150" Name="bottomTabContainer" 
                                                 SelectedTabIndex="0" 
                                                 TabItemContainerStyleSelector="{x:Null}"
                                                 ItemsSource="{Binding Path=BottomPands}"
                                                 />
                            </dxd:LayoutGroup>
                        </dxd:LayoutGroup>
                    </dxd:DockLayoutManager.LayoutRoot>
                </dxd:DockLayoutManager>

            </Grid>
        </dxb:BarManager>
        
        <dxre:RichEditControl Grid.Row="1" x:Name="RECDefaultRichEditControl" BarManager="{Binding ElementName=DxBarManager}" />
    </Grid>
</UserControl>
